﻿@*------------------------------------------------------------
  Copyright (c) Microsoft Corporation.  All rights reserved.
  Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
------------------------------------------------------------*@

@using Microsoft.Azure.IIoT.App.Services;
@using Microsoft.AspNetCore.Components;

@inject Registry RegistryHelper

<div class="drawer-content list-group">
    <div class="list-group-item text-justify list-group-item-heading">
        <b>Enter configuration parameters.</b>
        <br><b>To apply default config leave the input field blank and click on apply</b>
    </div>
    <hr />
    <div class="list-group-item text-left">
        <div class="label">
            Node Id:
            <div class="body">@NodeData.Id</div>
        </div><br />
        <div class="label">
            Display Name:
            <div class="body">@NodeData.NodeName</div>
        </div><br />
        <EditForm Model="@InputData" OnValidSubmit="@UpdatePublishedNodeConfigAsync">
            <FluentValidator />

            <div class="form-group">
                <div class="label">Publishing Interval ms</div>
                <input @bind="@InputData.RequestedPublishingInterval" aria-label="PublishingInterval" type="text" class="form-control" placeholder="@(InputData.RequestedPublishingInterval)" />
            </div><br />
            <div class="form-group">
                <div class="label">Sampling Interval ms </div>
                <input @bind="@InputData.RequestedSamplingInterval" aria-label="SamplingInterval" type="text" class="form-control" placeholder="@(InputData.RequestedSamplingInterval)" />
            </div><br />
            <div class="form-group">
                <div class="label">Heartbeat Interval sec</div>
                <input @bind="@InputData.RequestedHeartbeatInterval" aria-label="HeartbeatInterval" type="text" class="form-control" placeholder="@(InputData.RequestedHeartbeatInterval)" />
            </div><br />
            <hr />
            <ValidationSummary />
            <div>
                <button type="submit" class="btn btn-primary shadow-none">Apply</button>
            </div>
        </EditForm>
    </div>
</div>